Skip to content

GH-148468: Accept string-like proxy objects in colorized argparse help - #154653

Merged
savannahostrowski merged 5 commits into
python:mainfrom
savannahostrowski:fix-gh-148468-lazy-help
Jul 30, 2026
Merged

GH-148468: Accept string-like proxy objects in colorized argparse help#154653
savannahostrowski merged 5 commits into
python:mainfrom
savannahostrowski:fix-gh-148468-lazy-help

Conversation

@savannahostrowski

@savannahostrowski savannahostrowski commented Jul 24, 2026

Copy link
Copy Markdown
Member

@savannahostrowski savannahostrowski added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 24, 2026
@savannahostrowski

Copy link
Copy Markdown
Member Author

@hugovk (since it's colour-related) @clytaemnestra Perhaps one or both of you have some cycles to review this one :) ?

@hugovk

hugovk commented Jul 29, 2026

Copy link
Copy Markdown
Member

I left a comment at #148468 (comment) that I can no longer repro the MRE with latest 3.15 and main.

Is this change still needed or useful?

@savannahostrowski

Copy link
Copy Markdown
Member Author

Yes, seems like it. #148468 (comment)

Comment thread Lib/test/test_argparse.py
Comment thread Lib/test/test_argparse.py
Comment thread Lib/argparse.py Outdated
Comment thread Lib/argparse.py Outdated
savannahostrowski and others added 2 commits July 29, 2026 19:52
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Savannah Ostrowski <savannah@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@savannahostrowski
savannahostrowski enabled auto-merge (squash) July 30, 2026 15:30
@savannahostrowski

Copy link
Copy Markdown
Member Author

Thanks for the quick review, Hugo! And for being so thorough!

@savannahostrowski
savannahostrowski merged commit a147366 into python:main Jul 30, 2026
50 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @savannahostrowski for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jul 30, 2026

Copy link
Copy Markdown

GH-154946 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 30, 2026
savannahostrowski added a commit that referenced this pull request Jul 30, 2026
…rse help (GH-154653) (#154946)

GH-148468: Accept string-like proxy objects in colorized argparse help (GH-154653)
(cherry picked from commit a147366)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x RHEL9 Refleaks 3.15 (tier-3) has failed when building commit c22cbf8.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/2075/builds/319) and take a look at the build logs.
  4. Check if the failure is related to this commit (c22cbf8) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/2075/builds/319

Failed tests:

  • test.test_multiprocessing_fork.test_processes

Failed subtests:

  • test_interrupt - test.test_multiprocessing_fork.test_processes.WithProcessesTestProcess.test_interrupt

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/contextlib.py", line 116, in inner
    return func(*args, **kwds)
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/test/_test_multiprocessing.py", line 649, in test_interrupt
    exitcode = self._kill_process(multiprocessing.Process.interrupt)
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/contextlib.py", line 116, in inner
    return func(*args, **kwds)
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/test/_test_multiprocessing.py", line 630, in _kill_process
    self.assertEqual(join(), None)
                     ~~~~^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/test/_test_multiprocessing.py", line 303, in __call__
    return self.func(*args, **kwds)
           ~~~~~~~~~^^^^^^^^^^^^^^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/multiprocessing/process.py", line 156, in join
    res = self._popen.wait(timeout)
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/multiprocessing/popen_fork.py", line 44, in wait
    return self.poll(os.WNOHANG if timeout == 0.0 else 0)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/multiprocessing/popen_fork.py", line 28, in poll
    pid, sts = os.waitpid(self.pid, flag)
               ~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/test/_test_multiprocessing.py", line 626, in handler
    raise RuntimeError('join took too long: %s' % p)
RuntimeError: join took too long: <Process name='Process-4' pid=3251717 parent=3251712 started daemon>


Traceback (most recent call last):
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/contextlib.py", line 116, in inner
    return func(*args, **kwds)
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/test/_test_multiprocessing.py", line 649, in test_interrupt
    exitcode = self._kill_process(multiprocessing.Process.interrupt)
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/contextlib.py", line 116, in inner
    return func(*args, **kwds)
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/test/_test_multiprocessing.py", line 630, in _kill_process
    self.assertEqual(join(), None)
                     ~~~~^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/test/_test_multiprocessing.py", line 303, in __call__
    return self.func(*args, **kwds)
           ~~~~~~~~~^^^^^^^^^^^^^^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/multiprocessing/process.py", line 156, in join
    res = self._popen.wait(timeout)
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/multiprocessing/popen_fork.py", line 44, in wait
    return self.poll(os.WNOHANG if timeout == 0.0 else 0)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/multiprocessing/popen_fork.py", line 28, in poll
    pid, sts = os.waitpid(self.pid, flag)
               ~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/test/_test_multiprocessing.py", line 626, in handler
    raise RuntimeError('join took too long: %s' % p)
RuntimeError: join took too long: <Process name='Process-2101' pid=3232405 parent=3217137 started daemon>


Traceback (most recent call last):
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/multiprocessing/process.py", line 320, in _bootstrap
    self.run()
    ~~~~~~~~^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/test/_test_multiprocessing.py", line 576, in _sleep_some_event
    event.set()
    ~~~~~~~~~^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/multiprocessing/synchronize.py", line 349, in set
    with self._cond:
         ^^^^^^^^^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/multiprocessing/synchronize.py", line 247, in __exit__
    return self._lock.__exit__(*args)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/multiprocessing/synchronize.py", line 100, in __exit__
    return self._semlock.__exit__(*args)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
KeyboardInterrupt
k


Traceback (most recent call last):
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/multiprocessing/process.py", line 320, in _bootstrap
    self.run()
    ~~~~~~~~^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/buildbot/worker/cstratak-rhel9-s390x/3.15.cstratak-rhel9-s390x.refleak/build/Lib/test/_test_multiprocessing.py", line 577, in _sleep_some_event
    time.sleep(100)
    ~~~~~~~~~~^^^^^
KeyboardInterrupt
k

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants